@use '@angular/material/core/tokens/token-utils';
@use '@angular/material/core/style/sass-utils';

// The prefix used to generate the fully qualified name for tokens in this file.
$global-prefix: ngm;
$prefix: (ngm, indicator-market);
$prefix-color: (#{$prefix}, color);

@function get-unthemable-tokens() {
  @return (
    primary-container-rounded: var(--#{$global-prefix}-primary-container-rounded)
  );
}

@function get-color-tokens() {
  @return (
    color-surface: var(--#{$global-prefix}-color-surface),
  );
}

@function get-token-slots() {
  @return sass-utils.deep-merge-all(
    get-unthemable-tokens(),
    get-color-tokens(),
  );
}

@include token-utils.use-tokens($prefix, get-token-slots()) {
  .mat-drawer-container {
    border-top-left-radius: var(#{token-utils.get-token-variable(primary-container-rounded)});
  }
  .mat-drawer.mat-drawer-over {
    --mat-sidenav-container-background-color: var(#{token-utils.get-token-variable(color-surface)});
  }
  .mat-drawer-content {
    background-color: var(#{token-utils.get-token-variable(color-surface)});
    border-top-left-radius: var(#{token-utils.get-token-variable(primary-container-rounded)});
    // border-top-right-radius: var(#{token-utils.get-token-variable(primary-container-rounded)});
    @apply flex overflow-hidden; // for rounded corner overflow-visible;
  }
}

:host {
  flex: 1;
  max-width: 100%;
  display: flex;
  flex-direction: column;

  @include token-utils.create-token-values($prefix, get-token-slots());
}
